#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
void yzc1(int* p)
{
	for (int i = 0; i < 10; i++)
	{
		scanf("%d", p + i);
	}
}
void yzc2(int* p)
{
	int min=*p, max=*p;
	int x=0, y=0;
	for (int i = 1; i < 10; i++)
	{
		if (*(p + i ) < min)
		{
			min = *(p + i);
			x = i;
		}
		if (*(p + i) > max)
		{
			max = *(p + i);
			y = i;
		}
	}
	int tmp;
	tmp = *p;
	*p = p[x];
	p[x] = tmp;
	tmp = p[9];
	p[9] = p[y];
	p[y] = tmp;
}
void yzc3(int* p)
{
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", *(p + i));
	}
}
int main()
{
	int arr[10] = { 0 };
	int* p = arr;
	yzc1(p);
	yzc2(p);
	yzc3(p);
	return 0;
}
